From 742a9039fcd379851c0be3665516f44977e7b598 Mon Sep 17 00:00:00 2001 From: justbur Date: Wed, 15 Jul 2015 10:47:02 -0400 Subject: [PATCH] Add ability to temporarily prevent popups --- which-key.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/which-key.el b/which-key.el index bfc0ff5e5d2..067283a96e0 100644 --- a/which-key.el +++ b/which-key.el @@ -226,6 +226,13 @@ ignored." :group 'which-key :type 'function) +(defvar which-key-inhibit nil + "Prevent guide-key from popping up momentarily by setting this +to a non-nil value for the execution of a command. Like this + +\(let \(\(which-key-inhibit t\)\) +...\)") + ;; Internal Vars ;; (defvar popwin:popup-buffer nil) (defvar which-key--buffer nil @@ -904,7 +911,8 @@ Finally, show the buffer." ;; (when (> (length prefix-keys) 0) ;; (message "key binding: %s" (key-binding prefix-keys))) (when (and (> (length prefix-keys) 0) - (keymapp (key-binding prefix-keys))) + (keymapp (key-binding prefix-keys)) + (not which-key-inhibit)) (let* ((buf (current-buffer)) ;; get formatted key bindings (formatted-keys (which-key--get-formatted-key-bindings -- 2.30.2